package com.example.newsdaily.slice;

import com.example.newsdaily.ResourceTable;
import com.example.newsdaily.utl.ContainUtil;
import com.example.newsdaily.utl.LocalDataUtil;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;
import ohos.data.preferences.Preferences;

public class UserInfoAbilitySlice extends AbilitySlice {
    Preferences preferences= LocalDataUtil.preferences;
    String user_name=LocalDataUtil.preferences.getString(ContainUtil.USER_NAME_KEY,"");
    Text name;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_UserInfo);
        name=(Text)findComponentById(ResourceTable.Id_user_name);
        name.setText(user_name);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
